﻿Imports System.Data
Imports NVelocity
Imports NVelocity.App
Imports NVelocity.Context
Imports System.Collections.Generic
Imports System.Xml
Partial Class WebForm_SelfManageWorkHeader_SearchWorkHeader
    Inherits System.Web.UI.UserControl

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            Me.InitData()
            Me.BindTownID()
            Me.BindActive()
            'Me.BindGV()
        End If
    End Sub

    Protected Sub btnQuery_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btnQuery.Click
        Me.BindGV()
    End Sub

    Protected Sub btnExport_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btnExport.Click
        Me.Export()
    End Sub

    Protected Sub btnSelectExport_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btnSelectExport.Click
        Me.SelectedID = ""
        For i As Integer = 0 To gv.Rows.Count - 1
            If TryCast(gv.Rows(i).FindControl("chkSelect"), CheckBox).Checked Then
                If SelectedID = "" Then
                    Me.SelectedID = gv.DataKeys(i).Item("FindDirtyHeaderID")
                Else
                    Me.SelectedID &= "," & gv.DataKeys(i).Item("FindDirtyHeaderID")
                End If
            End If
        Next
        If Me.SelectedID = "" Then
            MyObj.ShowMessage(Me.GetLocalResourceObject("NoSelect"))
        Else
            Me.Export()
        End If

    End Sub

    Protected Sub btExport_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExport.PreRender
        ScriptManager.GetCurrent(Me.Page).RegisterPostBackControl(sender)
    End Sub

    Protected Sub btnSelectExport_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSelectExport.PreRender
        ScriptManager.GetCurrent(Me.Page).RegisterPostBackControl(sender)
    End Sub

#Region "Gridview事件"

    '編輯
    Protected Sub gv_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles gv.RowUpdating
        Dim key As DataKey = Me.gv.DataKeys(e.RowIndex)
        Me.FindDirtyHeaderID = key("FindDirtyHeaderID")
        RaiseEvent RowUpdating(Me, New EventArgs)
    End Sub
    '刪除
    Protected Sub gv_RowDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles gv.RowDeleting
        Dim key As DataKey = Me.gv.DataKeys(e.RowIndex)
        Me.FindDirtyHeaderID = key("FindDirtyHeaderID")
        RaiseEvent RowDeleting(Me, New EventArgs)
    End Sub

    Protected Sub gv_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gv.RowDataBound
        If e.Row.RowType = DataControlRowType.DataRow Then
            Dim lknDelete As LinkButton = TryCast(e.Row.FindControl("lknDelete"), LinkButton)
            If DataBinder.Eval(e.Row.DataItem, "Active") = "Y" Then
                Dim MyOrganizationID As String = clsAuth.GetOrganizationID(clsAuth.GetUserID())
                If DataBinder.Eval(e.Row.DataItem, "Status") = "P" And clsAuth.IsEnvirPerson(MyOrganizationID) Then '權責單位處理中才可刪除
                    lknDelete.Enabled = True
                Else
                    lknDelete.Enabled = False
                End If
            Else
                lknDelete.Enabled = False
                lknDelete.Text = Me.GetLocalResourceObject("Deleted")
                TryCast(e.Row.FindControl("lknEdit"), LinkButton).Enabled = False
            End If
        End If
    End Sub

    Protected Sub gv_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewPageEventArgs) Handles gv.PageIndexChanging
        Me.gv.PageIndex = e.NewPageIndex
        Me.BindGV()
    End Sub

    Protected Sub gv_Sorting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewSortEventArgs) Handles gv.Sorting
        Me.BindGV()
    End Sub

#End Region

    Protected Sub lknDelete_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim b1 As LinkButton = CType(sender, LinkButton)
        Dim cell1 As DataControlFieldCell = CType(b1.Parent, DataControlFieldCell)
        Dim row1 As GridViewRow = CType(cell1.Parent, GridViewRow)

        Dim dat As New clsData
        Dim sql As New MyStringBuilder

        sql.AppendFormat("update FD_FindDirtyHeader set Active='N' ")
        sql.AppendFormat("where FindDirtyHeaderID='{0}' ", gv.DataKeys(row1.RowIndex).Item("FindDirtyHeaderID").ToString())

        dat.AccData(sql.ToString())
        Me.BindGV()
    End Sub
End Class

Partial Class WebForm_SelfManageWorkHeader_SearchWorkHeader
#Region "初始化資料"
    Private Sub InitData()
        Me.BindRegionType()
        Me.BindStatus()
    End Sub
#End Region

#Region "繫結資料"
    Private Sub BindTownID()
        Dim ddl As DropDownList = Me.ddlTownID

        ddl.DataTextField = "RegionName"
        ddl.DataValueField = "RegionID"
        ddl.DataSource = MyObj.GetTownData("TPC")
        ddl.DataBind()

        ddl.Items.Insert(0, MyObj.GetDDLSelectAllItem())
    End Sub

    Private Sub BindRegionType()
        Dim ddlItem As DropDownList = Me.ddlRegionType
        ddlItem.DataTextField = "Text"
        ddlItem.DataValueField = "Value"
        ddlItem.DataSource = MyObj.GetCodeMappingData("FindDirtyHeader", "RegionType")
        ddlItem.DataBind()
        ddlItem.Items.Insert(0, MyObj.GetDDLSelectAllItem())
    End Sub

    Private Sub BindActive()
        Dim ddlItem As DropDownList = Me.ddlActive
        ddlItem.DataTextField = "Text"
        ddlItem.DataValueField = "Value"
        ddlItem.DataSource = MyObj.GetCodeMappingData("FindDirtyHeader", "Active")
        ddlItem.DataBind()
        ddlItem.Items.Insert(0, MyObj.GetDDLSelectAllItem())
        MyObj.MatchItem(ddlItem, "Y")
    End Sub

    Private Sub BindStatus()
        Me.ddlStatus.DataTextField = "Text"
        Me.ddlStatus.DataValueField = "Value"
        Me.ddlStatus.DataSource = MyObj.GetCodeMappingData("FindDirtyHeader", "Status")
        Me.ddlStatus.DataBind()
        Me.ddlStatus.Items.Insert(0, MyObj.GetDDLSelectAllItem())
    End Sub
#End Region

#Region "方法"

    Public Function BindGV() As Data.DataTable
        Dim MyOrganizationID As String = clsAuth.GetOrganizationID(clsAuth.GetUserID())
        Dim dat As New clsData
        Dim sql As New MyStringBuilder
        Dim dt As Data.DataTable

        sql.AppendFormat("select distinct a.*,b.RegionName,d.RoadItemName,a.Location,a.Location as Address,c.Text as StatusText ")
        sql.AppendFormat(" ,Case a.RegionType when '{0}' then '' else e.RoadName end as RoadName", "道路")
        sql.AppendFormat(" from FD_FindDirtyHeader a")
        sql.AppendFormat(" Join Region b on a.TownID=b.RegionID")
        sql.AppendFormat(" left Join FD_CodeMapping c on a.Status=c.Value and c.TableName='FindDirtyHeader' and c.ColumnName='Status' and c.Active='Y'")
        sql.AppendFormat(" and b.RegionType='T'")

        sql.AppendFormat(" left Join FD_RoadItem d ")
        sql.AppendFormat(" on d.RoadItemID = a.RoadItemID")

        sql.AppendFormat(" left Join RegionRoad e ")
        sql.AppendFormat(" on e.RoadID = a.VillageID")

        sql.AppendFormat(" where 1=1")

        If Me.txtFindDirtyHeaderID.Text.Trim <> "" Then
            sql.AppendFormat(" and a.CasePassword='{0}'", Me.txtFindDirtyHeaderID.Text.Trim)
        End If
        If Me.txtCreateBy.Text.Trim <> "" Then
            sql.AppendFormat(" and a.CreateBy like '%{0}%'", Me.txtCreateBy.Text.Trim)
        End If
        If Me.txtCreateTel.Text.Trim <> "" Then
            sql.AppendFormat(" and a.CreateTel like '%{0}%'", Me.txtCreateTel.Text.Trim)
        End If
        If Me.txtCreateEmail.Text.Trim <> "" Then
            sql.AppendFormat(" and a.CreateEmail like '%{0}%'", Me.txtCreateEmail.Text.Trim)
        End If
        If Me.ddlRegionType.SelectedValue <> "" Then
            sql.AppendFormat(" and a.RegionType='{0}'", Me.ddlRegionType.SelectedItem.Text)
        End If
        If Me.txtReportDateStart.Text.Trim <> "" Then
            sql.AppendFormat(" and a.ReportDate>='{0:yyyy/MM/dd}'", Me.txtReportDateStart.Text.Trim)
        End If
        If Me.txtReportDateEnd.Text.Trim <> "" Then
            sql.AppendFormat(" and a.ReportDate<=DateAdd(dd,1,'{0:yyyy/MM/dd}')", Me.txtReportDateEnd.Text.Trim)
        End If
        If Me.txtHandleDateStart.Text.Trim <> "" Then
            sql.AppendFormat(" and a.HandleDate>='{0:yyyy/MM/dd}'", Me.txtHandleDateStart.Text.Trim)
        End If
        If Me.txtHandleDateEnd.Text.Trim <> "" Then
            sql.AppendFormat(" and a.HandleDate<=DateAdd(dd,1,'{0:yyyy/MM/dd}')", Me.txtHandleDateEnd.Text.Trim)
        End If
        If Me.ddlTownID.SelectedValue <> "" Then
            sql.AppendFormat(" and a.TownID='{0}'", Me.ddlTownID.SelectedValue)
        End If
        If Me.ddlStatus.SelectedValue <> "" Then
            sql.AppendFormat(" and a.Status='{0}'", Me.ddlStatus.SelectedValue)
        End If
        If Me.ddlActive.SelectedValue <> "" Then
            sql.AppendFormat(" and a.Active='{0}'", Me.ddlActive.SelectedValue)
        End If

        If Me.SelectedID <> "" Then
            sql.AppendFormat(" and a.FindDirtyHeaderID in ('{0}')", Me.SelectedID.Replace(",", "','"))
            Me.SelectedID = ""
        End If

        sql.AppendFormat(" and a.CasePassword in( ", Me.SelectedID.Replace(",", "','"))
        sql.AppendFormat(" select CasePassword from FD_ActionRecord where OrganizationID in(select '{0}' union select Value from fn_GetAllSonsByOrganizationID('{0}')) ", clsAuth.GetOrganizationID(clsAuth.GetUserID()))
        sql.AppendFormat(" )")

        If Me.gv.OrderBySQL = "" Then
            sql.AppendFormat(" order by b.RegionName,a.CreateDate desc")
        Else
            sql.AppendFormat(Me.gv.OrderBySQL)
        End If
        dt = dat.GetData(sql)

        MyObj.SetDateLocale("zh-TW")
        Me.gv.DataSource = dt
        Me.gv.DataBind()
        MyObj.SetDateLocale("")

        RaiseEvent DataBound(Me, New EventArgs)
        Me.gv.SelectedIndex = -1

        If Not dt.Rows.Count > 0 Then
            Me.btnExport.Visible = False
            Me.btnSelectExport.Visible = False
        Else
            Me.btnExport.Visible = True
            Me.btnSelectExport.Visible = True
        End If

        '環保局人員才需看到鄉鎮市欄位
        If Not clsAuth.IsEnvirPerson(MyOrganizationID) Then
            Me.gv.Columns(1).Visible = False
        End If

        Return dt
    End Function

    Protected Sub Export()
        Dim LocalPath As String = MyObj.GetParameter("Local", "PicPath")
        Dim dat As New clsData
        Dim sql As New StringBuilder
        Dim dt, dt2 As DataTable
        dt = Me.BindGV()

        Dim vList As New List(Of MyList)
        Dim v As MyList

        Dim i, j, k As Integer
        For i = 0 To dt.Rows.Count - 1

            v = New MyList

            Dim dtSalary As New DataTable
            Dim dtSalaryMinus As New DataTable

            MyObj.SetDateLocale("zh-TW")
            Dim SalaryMonth As String() = dt.Rows(i)("CreateBy").ToString().Split("/")
            v.FindDirtyHeaderID = dt.Rows(i)("CasePassword").ToString() '編號
            v.CreateBy = dt.Rows(i)("CreateBy").ToString() '通報人姓名
            v.ReportDate = Convert.ToDateTime(dt.Rows(i)("ReportDate")).ToString("yyyy年MM月dd日") '通報日期
            v.CreateTel = dt.Rows(i)("CreateTel").ToString '通報人電話
            v.RegionName = dt.Rows(i)("RegionName").ToString '髒亂點轄區
            v.OrganizationName = dt.Rows(i)("RegionName").ToString & "公所" '髒亂點轄區
            v.DirtyPlace = dt.Rows(i)("RoadName").ToString & dt.Rows(i)("RoadItemName").ToString & dt.Rows(i)("Location").ToString '髒亂地點
            v.Description = dt.Rows(i)("Description").ToString '髒亂描述
            v.StatusText = dt.Rows(i)("Memo").ToString '處理情形
            If dt.Rows(i)("HandleDate").ToString() <> "" Then '處理日期
                v.HandleDate = Convert.ToDateTime(dt.Rows(i)("HandleDate")).ToString("yyyy年MM月dd日")
            Else
                v.HandleDate = ""
            End If
            v.CloseDate = ""
            'If dt.Rows(i)("NewCloseDate").ToString() <> "" Then '結案日期
            '    v.CloseDate = Convert.ToDateTime(dt.Rows(i)("CloseDate")).ToString("yyyy年MM月dd日")
            'Else
            '    v.CloseDate = ""
            'End If
            MyObj.SetDateLocale("")

            Dim FilePath As String = ""
            '取處理前照片
            sql.Length = 0
            sql.AppendFormat("SELECT Top 8 * FROM [FD_UploadFile]")
            sql.AppendFormat(" where CasePassword='{0}' ", dt.Rows(i)("CasePassword").ToString())
            sql.AppendFormat(" and UploadType='{0}' ", "PictureA")
            sql.AppendFormat(" Order by CreateDay")
            dt2 = dat.GetData(sql.ToString())

            v.PictureA1 = ""
            v.PictureA2 = ""
            v.PictureA3 = ""
            v.PictureA4 = ""
            v.PictureA5 = ""
            v.PictureA6 = ""
            v.PictureA7 = ""
            v.PictureA8 = ""
            k = 0
            For j = 0 To dt2.Rows.Count - 1
                FilePath = Server.MapPath("~/") & "/public/UploadFile/" & dt2.Rows(j)("FileName_New").ToString()
                If IO.File.Exists(FilePath) Then
                    k += 1
                    Select Case k
                        Case 1
                            v.PictureA1 = GetImageItem(FilePath)
                        Case 2
                            v.PictureA2 = GetImageItem(FilePath)
                        Case 3
                            v.PictureA3 = GetImageItem(FilePath)
                        Case 4
                            v.PictureA4 = GetImageItem(FilePath)
                        Case 5
                            v.PictureA5 = GetImageItem(FilePath)
                        Case 6
                            v.PictureA6 = GetImageItem(FilePath)
                        Case 7
                            v.PictureA7 = GetImageItem(FilePath)
                        Case 8
                            v.PictureA8 = GetImageItem(FilePath)
                    End Select
                End If
            Next

            '取處理後照片
            sql.Length = 0
            sql.AppendFormat("SELECT Top 8 * FROM [FD_UploadFile]")
            sql.AppendFormat(" where CasePassword='{0}' ", dt.Rows(i)("CasePassword").ToString())
            sql.AppendFormat(" and UploadType='{0}' ", "PictureB")
            sql.AppendFormat(" Order by CreateDay")
            dt2 = dat.GetData(sql.ToString())

            v.PictureB1 = ""
            v.PictureB2 = ""
            v.PictureB3 = ""
            v.PictureB4 = ""
            v.PictureB5 = ""
            v.PictureB6 = ""
            v.PictureB7 = ""
            v.PictureB8 = ""
            k = 0
            For j = 0 To dt2.Rows.Count - 1
                FilePath = Server.MapPath("~/") & "/public/UploadFile/" & dt2.Rows(j)("FileName_New").ToString()
                If IO.File.Exists(FilePath) Then
                    k += 1
                    Select Case k
                        Case 1
                            v.PictureB1 = GetImageItem(FilePath)
                        Case 2
                            v.PictureB2 = GetImageItem(FilePath)
                        Case 3
                            v.PictureB3 = GetImageItem(FilePath)
                        Case 4
                            v.PictureB4 = GetImageItem(FilePath)
                        Case 5
                            v.PictureB5 = GetImageItem(FilePath)
                        Case 6
                            v.PictureB6 = GetImageItem(FilePath)
                        Case 7
                            v.PictureB7 = GetImageItem(FilePath)
                        Case 8
                            v.PictureB8 = GetImageItem(FilePath)
                    End Select
                End If
            Next


            '取髒亂種類
            sql.Length = 0
            sql.AppendFormat("Select * from FD_FindDirtyItem")
            sql.AppendFormat(" where FindDirtyHeaderID='{0}' ", dt.Rows(i)("FindDirtyHeaderID").ToString())
            dt2 = dat.GetData(sql.ToString())
            v.DirtyItems = ""
            For j = 0 To dt2.Rows.Count - 1
                If j <> 0 And (j = 4 Or j = 8) Then
                    v.DirtyItems &= "<w:p/>" 'word斷行
                End If
                If j <> 0 Then
                    v.DirtyItems &= "、"
                End If
                v.DirtyItems &= dt2.Rows(j)("DirtyItemName").ToString()
            Next
            vList.Add(v)
        Next


        'Print
        Dim fileName As String = "DirtyExport.doc"
        Response.AppendHeader("Content-Disposition", "attachment;filename=" + fileName)
        Response.ContentType = "application/msword"

        Dim velocity As New VelocityEngine
        Dim props As New Commons.Collections.ExtendedProperties

        'fix bug
        props.AddProperty("file.resource.loader.path", Server.MapPath("~\App_Data"))
        props.AddProperty("input.encoding", "utf-8")
        props.AddProperty("output.encoding", "utf-8")
        velocity.Init(props)

        Dim template As Template

        Dim context As New VelocityContext

        template = velocity.GetTemplate("台北縣環境髒亂通報單.xml")
        context.Put("MyList", vList)

        Dim writer As New IO.StringWriter
        template.Merge(context, writer)

        Response.Write(writer.GetStringBuilder().ToString())

        Response.End()

    End Sub

    '將圖檔編碼
    Private Function base64pic(ByVal picpath As String) As String
        Dim img As System.Drawing.Image = System.Drawing.Image.FromFile(picpath)
        Dim mm As New System.IO.MemoryStream()
        img.Save(mm, System.Drawing.Imaging.ImageFormat.Png)
        Return Convert.ToBase64String(mm.GetBuffer())
    End Function

    '取得圖檔字串
    Private Function GetImageItem(ByVal picpath As String) As String
        Dim PicItem As String = ""
        Dim FileName As String = ""
        Dim ImgWidth, ImgHeight As String
        Dim img As System.Drawing.Image = System.Drawing.Image.FromFile(picpath)
        FileName = System.IO.Path.GetFileName(picpath)

        If img.Width > 220 Then
            ImgWidth = 220
            ImgHeight = img.Height / (img.Width / 220)
        Else
            ImgHeight = img.Height
            ImgWidth = img.Width
        End If

        If img.Height > 120 Then
            ImgHeight = 120
            ImgWidth = img.Width / (img.Height / 120)
        End If

        PicItem = " <w:pict>"
        PicItem &= "<w:binData w:name='wordml://" & FileName & "'>"
        PicItem &= Me.base64pic(picpath)
        PicItem &= "</w:binData>"
        PicItem &= "<v:shape id='_x0000_i1025' type='#_x0000_t75' style='width:" & ImgWidth & "pt;height:" & ImgHeight & "pt'>"
        PicItem &= "<v:imagedata src='wordml://" & FileName & "' o:title='network'/>"
        PicItem &= "</v:shape>"
        PicItem &= "</w:pict>"
        img.Dispose()

        Return PicItem
    End Function

    '取得說明字串
    Private Function GetDescription(ByVal xmlName As String) As String
        Dim sr As IO.StreamReader = New IO.StreamReader(Server.MapPath("~\App_Data\" & xmlName))
        Dim xmlData = sr.ReadToEnd()
        sr.Close()

        Return xmlData
    End Function
#End Region

#Region "屬性"
    Public Property FindDirtyHeaderID() As String
        Get
            Return ViewState("FindDirtyHeaderID")
        End Get
        Set(ByVal value As String)
            ViewState("FindDirtyHeaderID") = value
        End Set
    End Property

    Public Property SelectedID() As String
        Get
            If ViewState("SelectedID") Is Nothing Then
                Return ""
            Else
                Return ViewState("SelectedID")
            End If
        End Get
        Set(ByVal value As String)
            ViewState("SelectedID") = value
        End Set
    End Property

    Public ReadOnly Property Count() As Integer
        Get
            Return Me.gv.Rows.Count
        End Get
    End Property
#End Region

#Region "事件"
    Public Event RowUpdating(ByVal source As Object, ByVal e As EventArgs)
    Public Event RowDeleting(ByVal source As Object, ByVal e As EventArgs)
    Public Event DataBound(ByVal source As Object, ByVal e As EventArgs)
#End Region

End Class

Public Class MyList
    Private FindDirtyHeaderIDField As String
    Private ReportDateField As String
    Private CreateByField As String
    Private CreateTelField As String
    Private DirtyPlaceField As String
    Private DescriptionField As String
    Private RegionNameField As String
    Private OrganizationNameField As String
    Private StatusTextField As String
    Private HandleDateField As String
    Private CloseDateField As String
    Private xmlDescriptionField As String
    Private DirtyItemsField As String
    Private PictureA1Field As String
    Private PictureA2Field As String
    Private PictureA3Field As String
    Private PictureA4Field As String
    Private PictureA5Field As String
    Private PictureA6Field As String
    Private PictureA7Field As String
    Private PictureA8Field As String
    Private PictureB1Field As String
    Private PictureB2Field As String
    Private PictureB3Field As String
    Private PictureB4Field As String
    Private PictureB5Field As String
    Private PictureB6Field As String
    Private PictureB7Field As String
    Private PictureB8Field As String

    Public Property FindDirtyHeaderID() As String
        Get
            Return Me.FindDirtyHeaderIDField
        End Get
        Set(ByVal value As String)
            Me.FindDirtyHeaderIDField = value
        End Set
    End Property

    Public Property ReportDate() As String
        Get
            Return Me.ReportDateField
        End Get
        Set(ByVal value As String)
            Me.ReportDateField = value
        End Set
    End Property

    Public Property CreateBy() As String
        Get
            Return Me.CreateByField
        End Get
        Set(ByVal value As String)
            Me.CreateByField = value
        End Set
    End Property

    Public Property CreateTel() As String
        Get
            Return Me.CreateTelField
        End Get
        Set(ByVal value As String)
            Me.CreateTelField = value
        End Set
    End Property

    Public Property RegionName() As String
        Get
            Return Me.RegionNameField
        End Get
        Set(ByVal value As String)
            Me.RegionNameField = value
        End Set
    End Property

    Public Property OrganizationName() As String
        Get
            Return Me.OrganizationNameField
        End Get
        Set(ByVal value As String)
            Me.OrganizationNameField = value
        End Set
    End Property

    Public Property DirtyPlace() As String
        Get
            Return Me.DirtyPlaceField
        End Get
        Set(ByVal value As String)
            Me.DirtyPlaceField = value
        End Set
    End Property

    Public Property Description() As String
        Get
            Return Me.DescriptionField
        End Get
        Set(ByVal value As String)
            Me.DescriptionField = value
        End Set
    End Property

    Public Property StatusText() As String
        Get
            Return Me.StatusTextField
        End Get
        Set(ByVal value As String)
            Me.StatusTextField = value
        End Set
    End Property

    Public Property HandleDate() As String
        Get
            Return Me.HandleDateField
        End Get
        Set(ByVal value As String)
            Me.HandleDateField = value
        End Set
    End Property

    Public Property CloseDate() As String
        Get
            Return Me.CloseDateField
        End Get
        Set(ByVal value As String)
            Me.CloseDateField = value
        End Set
    End Property

    Public Property xmlDescription() As String
        Get
            Return Me.xmlDescriptionField
        End Get
        Set(ByVal value As String)
            Me.xmlDescriptionField = value
        End Set
    End Property

    Public Property DirtyItems() As String
        Get
            Return Me.DirtyItemsField
        End Get
        Set(ByVal value As String)
            Me.DirtyItemsField = value
        End Set
    End Property

#Region "處理前照片"
    Public Property PictureA1() As String
        Get
            Return Me.PictureA1Field
        End Get
        Set(ByVal value As String)
            Me.PictureA1Field = value
        End Set
    End Property
    Public Property PictureA2() As String
        Get
            Return Me.PictureA2Field
        End Get
        Set(ByVal value As String)
            Me.PictureA2Field = value
        End Set
    End Property
    Public Property PictureA3() As String
        Get
            Return Me.PictureA3Field
        End Get
        Set(ByVal value As String)
            Me.PictureA3Field = value
        End Set
    End Property
    Public Property PictureA4() As String
        Get
            Return Me.PictureA4Field
        End Get
        Set(ByVal value As String)
            Me.PictureA4Field = value
        End Set
    End Property
    Public Property PictureA5() As String
        Get
            Return Me.PictureA5Field
        End Get
        Set(ByVal value As String)
            Me.PictureA5Field = value
        End Set
    End Property
    Public Property PictureA6() As String
        Get
            Return Me.PictureA6Field
        End Get
        Set(ByVal value As String)
            Me.PictureA6Field = value
        End Set
    End Property
    Public Property PictureA7() As String
        Get
            Return Me.PictureA7Field
        End Get
        Set(ByVal value As String)
            Me.PictureA7Field = value
        End Set
    End Property
    Public Property PictureA8() As String
        Get
            Return Me.PictureA8Field
        End Get
        Set(ByVal value As String)
            Me.PictureA8Field = value
        End Set
    End Property
#End Region

#Region "處理後照片"
    Public Property PictureB1() As String
        Get
            Return Me.PictureB1Field
        End Get
        Set(ByVal value As String)
            Me.PictureB1Field = value
        End Set
    End Property
    Public Property PictureB2() As String
        Get
            Return Me.PictureB2Field
        End Get
        Set(ByVal value As String)
            Me.PictureB2Field = value
        End Set
    End Property
    Public Property PictureB3() As String
        Get
            Return Me.PictureB3Field
        End Get
        Set(ByVal value As String)
            Me.PictureB3Field = value
        End Set
    End Property
    Public Property PictureB4() As String
        Get
            Return Me.PictureB4Field
        End Get
        Set(ByVal value As String)
            Me.PictureB4Field = value
        End Set
    End Property
    Public Property PictureB5() As String
        Get
            Return Me.PictureB5Field
        End Get
        Set(ByVal value As String)
            Me.PictureB5Field = value
        End Set
    End Property
    Public Property PictureB6() As String
        Get
            Return Me.PictureB6Field
        End Get
        Set(ByVal value As String)
            Me.PictureB6Field = value
        End Set
    End Property
    Public Property PictureB7() As String
        Get
            Return Me.PictureB7Field
        End Get
        Set(ByVal value As String)
            Me.PictureB7Field = value
        End Set
    End Property
    Public Property PictureB8() As String
        Get
            Return Me.PictureB8Field
        End Get
        Set(ByVal value As String)
            Me.PictureB8Field = value
        End Set
    End Property
#End Region
End Class



